/**
 * @brief 堆栈信息读取和保存记录
 * @version 1.0
 * @date 2024-1-11
 * @author 宋炜
 */

#pragma once
#include <string>
#include <fstream>

#include "designM/singleton.hpp"
#include "ary_str.hpp"
namespace wheels
{
class backtrace : public wheels::dm::singleton< backtrace >
{
private:
    std::string     m_file__;
    std::ofstream   m_ofs__;
private:
    void read_info__( wheels::ArrayString& data );
public:
    explicit backtrace( const std::string& file );
    virtual ~backtrace();
    /**
     * @brief dump
     */
    void dump();
    void close(){ m_ofs__.close(); }
};
}
